package com.ruoyi.ltd_web.service.impl;

import java.util.List;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ltd_web.mapper.LtdJobIntelMapper;
import com.ruoyi.ltd_web.domain.LtdJobIntel;
import com.ruoyi.ltd_web.service.ILtdJobIntelService;

/**
 * 招聘信息Service业务层处理
 *
 * @author ruoyi
 * @date 2025-03-18
 */
@Service
public class LtdJobIntelServiceImpl implements ILtdJobIntelService
{
    @Autowired
    private LtdJobIntelMapper ltdJobIntelMapper;

    /**
     * 查询招聘信息
     *
     * @param id 招聘信息主键
     * @return 招聘信息
     */
    @Override
    public LtdJobIntel selectLtdJobIntelById(Long id)
    {
        return ltdJobIntelMapper.selectLtdJobIntelById(id);
    }

    /**
     * 查询招聘信息列表
     *
     * @param ltdJobIntel 招聘信息
     * @return 招聘信息
     */
    @Override
    public List<LtdJobIntel> selectLtdJobIntelList(LtdJobIntel ltdJobIntel)
    {
        return ltdJobIntelMapper.selectLtdJobIntelList(ltdJobIntel);
    }

    /**
     * 新增招聘信息
     *
     * @param ltdJobIntel 招聘信息
     * @return 结果
     */
    @Override
    public int insertLtdJobIntel(LtdJobIntel ltdJobIntel)
    {
        ltdJobIntel.setCreateTime(DateUtils.getNowDate());
        return ltdJobIntelMapper.insertLtdJobIntel(ltdJobIntel);
    }

    /**
     * 修改招聘信息
     *
     * @param ltdJobIntel 招聘信息
     * @return 结果
     */
    @Override
    public int updateLtdJobIntel(LtdJobIntel ltdJobIntel)
    {
        ltdJobIntel.setUpdateTime(DateUtils.getNowDate());
        return ltdJobIntelMapper.updateLtdJobIntel(ltdJobIntel);
    }

    /**
     * 批量删除招聘信息
     *
     * @param ids 需要删除的招聘信息主键
     * @return 结果
     */
    @Override
    public int deleteLtdJobIntelByIds(Long[] ids)
    {
        return ltdJobIntelMapper.deleteLtdJobIntelByIds(ids);
    }

    /**
     * 删除招聘信息信息
     *
     * @param id 招聘信息主键
     * @return 结果
     */
    @Override
    public int deleteLtdJobIntelById(Long id)
    {
        return ltdJobIntelMapper.deleteLtdJobIntelById(id);
    }

    @Override
    public AjaxResult updateLtdJobIntelStatus(Long id) {
        return AjaxResult.success(ltdJobIntelMapper.updateLtdJobIntelStatus(id));
    }
}
